package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/***********************************************************************
 * Module:  Location.java
 * Author:  zhangjh
 * Purpose: Defines the Class Location
 ***********************************************************************/
@Entity
@Table(name = "location")
@DynamicInsert(value = true)
@DynamicUpdate(value = true)
public class Location extends IDEntityMall {

        @Column(name = "fristPinyin",columnDefinition = "varchar(255) comment '拼音首字母'")
        public String firstPinyin;
        @Column(columnDefinition = "int(11) comment '层级'")
        public int level;
        @Column(columnDefinition = "varchar(255) comment '地方名'")
        public String locationName;
        @Column(columnDefinition = "varchar(255) comment '父级ID'")
        public String parentId;
        @Column(columnDefinition = "int(1) comment '状态'")
        public int state=0;


    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public String getLocationName() {
        return locationName;
    }

    public void setLocationName(String locationName) {
        this.locationName = locationName;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getFirstPinyin() {
        return firstPinyin;
    }

    public void setFirstPinyin(String firstPinyin) {
        this.firstPinyin = firstPinyin;
    }

    @Override
    public String toString() {
        return "Location{" +
                "id=" + id +
                ", dateCreated=" + dateCreated +
                ", firstPinyin='" + firstPinyin + '\'' +
                ", level=" + level +
                ", lastUpdated=" + lastUpdated +
                ", locationName='" + locationName + '\'' +
                ", isDelete=" + isDelete +
                ", parentId='" + parentId + '\'' +
                ", version=" + version +
                ", state=" + state +
                '}';
    }
}
